import request  from '@/utils/request';

import { BASE_URL, OPS_URL, env, USER_URL } from '@/config/query';

const type = (BASE_URL)

export async function queryTaskPage(params) {
  return request(`${type}/rule/page`, params)
}

export async function queryTargetList(params) {
  params.state = 1;
  return request(`${type}/rule_target/list`, params)
}

export async function copy(id) {
  return request(`${type}/rule/copy/${id}`)
}

export async function queryTaskById(id) {
  return request(`${type}/rule/detail/${id}`)
}

export async function create() {
  return request(`${type}/rule/create`, { cycle: 3, state: 2 })
}

export async function update(params) {
  return request(`${type}/rule/modify`, params);
}

export async function remove(id) {
  return request(`${type}/rule/remove/${id}`)
}

export async function queryPerson() {
  return request(`${OPS_URL}/user/list`)
}

export async function queryFloorPage(params) {
  return request(`${type}/floor_plan/page`, {...params})
}

export async function batch(params) {
  return request(`${type}/rule_target/batch`, params)
}

export async function updateTarget(params) {
  return request(`${type}/rule_target/modify`, params)
}

export async function queryItemDetails(id) {
  return request(`${type}/rule_target/detail/${id}`)
}


export async function queryReportPage(params) {
  return request(`${type}/rule_task/page`, params)
}

export async function queryReportDetails(id) {
  return request(`${type}/rule_task/report/detail/${id}`)
}

export async function updateRuleTask(params) {
  return request(`${type}/rule_target/item/modify`, params)
}